-- Vibrator
-- Create by zouyb
-- 手机震动

module("Vibrator", package.seeall);

---------------------------------
-- 手机震动
-- @param time 震动时间 （单位：毫秒）
function vibrate(time)
    print("vibrate:"..time);
	if isAndroidPlatform() then
		callJavaFunc("vibrate", { time }, "(F)V");
    elseif isIphonePlatform() or isIpadPlatform() then
        ret = callOCFunc("vibrate");
    else
	end
end

---------------------------------
-- 手机停止震动
function cancelVibrate(time)
    if isAndroidPlatform() then
        callJavaFunc("cancelVibrate", {}, "()V");
	end
end


